/**
 * @description 发送请求
 * @auther zhcat
 */
'use strict';

const axios = require('axios');

const BASE_URL = process.env.SPIRITOS_CLI_BASE_URL?process.env.SPIRITOS_CLI_BASE_URL:"http://spirit.os.cli:7001/"

const request = axios.create({
  baseURL:BASE_URL,
  timeout:5000
})

request.interceptors.response.use(response=>{
  if(response.status === 200){
    return response.data
  }
},error=>{
  return new Promise.reject(error)
})

module.exports = request;